﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using System.Windows.Forms;
using Traceability.Commont.Domains.ScratchTheFat;
using static Butcher.winform.EnterpriseForms.DeductionHtml;

namespace Butcher.winform.EnterpriseForms
{
    public partial class LoginMage : Form
    {
        public LoginMage()
        {
            InitializeComponent();
            GEthtml();
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {


            

        }


        public void GEthtml()
        {

            string url = @"http://localhost:5229/api/Batch/LoginHtml";
            HttpClient client = new HttpClient();
            Empty list1 = new Empty();
            var content = new StringContent(JsonSerializer.Serialize<Empty>(list1), Encoding.UTF8);
            content.Headers.Remove("Content-Type");
            content.Headers.Add("Content-Type", "application/json");
            string result = client.PostAsync(url, content).Result.Content.ReadAsStringAsync().Result;
            JObject josnresult = JObject.Parse(result);
            var results = josnresult["date"].Value<JArray>();


            List<NewLogions> ssss = results.ToObject<List<NewLogions>>();


            dataGridView1.DataSource = ssss;
        }



        public class Empty
        {



        }
    }
}
